
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
<%@page import="gruppe7.util.Html" %>
<%@page import="gruppe7.model.User" %>
<%@page import="gruppe7.model.Model" %>
<%@page import="gruppe7.control.ServletController" %>

<%
Html html = new Html(); 
ServletController sc = ServletController.getInstance();
User user = sc.getSession(request, response).getUser();
Model model = Model.getInstance();
%>

<% out.print(html.setHeader("Edit station")); %>

<body>
<jsp:include page="main_links.jsp" />

<div id ='content'>
<div id='content-left'>
<h3><img src='images/edit.png'/> Edit station info</h3><br/> 

<%
	if (user.isAdminUser()) {
		out.println(""
    			+ "<p><table class='default'>"
                + "<form action='show_specific_station.jsp' method='post'>"
                + "<tr><td>Choose station : </td>"
                + "<td><select name='station'>");
		
		try {
			
			for (String stationName : model.getStationList()) {
    			out.println("<option value='" + stationName + "'>" + stationName + "</option>");
    		}
    		
    		out.println("</select></td></tr></br>"
                    + "<tr><td></td><td align='right'><input type='submit' value='Edit' class='submit'/></td></tr>");
            out.println("</table>");	
		}
		
		catch (Exception e) {
			sc.sendToErrorPage(response);
		}
	}

	else {
		out.println("You have to be an administrator to use this feature");
	}

%>


</div></div>

<%
out.println(html.setFooter());
%>
